package com.bckj.freshnow.order.trade.fsm;

import com.alibaba.cola.statemachine.Action;
import com.bckj.freshnow.order.trade.fsm.enums.TradeBillStatementEventEnum;
import com.bckj.freshnow.order.trade.fsm.enums.TradeBillStatementStatusEnum;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class TradeBillStatementAction implements Action<TradeBillStatementStatusEnum, TradeBillStatementEventEnum, TradeBillContext> {

    @Override
    public void execute(TradeBillStatementStatusEnum from, TradeBillStatementStatusEnum to, TradeBillStatementEventEnum event, TradeBillContext ctx) {
        ctx.setFrom(from);
        switch (event) {
            case PAY_CALLBACK_SUCCESS -> {
                log.info("账单流水的支付请求回调成功");

            }
            case BILL_STATEMENT_CLOSE -> {
                log.info("账单发起账单流水关闭");

            }
        }
    }
}
